package com.sqx.modules.sign.controller;

import com.sqx.common.utils.Result;
import com.sqx.modules.sign.entity.TbSigninReward;
import com.sqx.modules.sign.service.TbSigninRewardService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @description：TODO
 * @author： qiao
 * @create： 2024/9/30 11:33
 */
@RestController
@RequestMapping("/admin/signInReward/")
@Api(value = "签到配置金币相关-管理端",tags = {"签到配置金币相关-管理端"})
public class AdminSignInRewardController {

    @Autowired
    private TbSigninRewardService tbSignInRewardService;

    @PostMapping("addSignInReward")
    @ApiOperation("添加或修改签到金币配置表")
    public Result addSignInReward(@ApiParam("签到天数奖励实体") TbSigninReward tbSignInReward){
        return tbSignInRewardService.addSignInReward(tbSignInReward);
    }

    @PostMapping("deleteSignInReward")
    @ApiOperation("删除签到金币配置表")
    public Result deleteSignInReward(@ApiParam("签到天数奖励id")Long id){
        return tbSignInRewardService.deleteSignInReward(id);
    }

    @GetMapping("selectSignInRewardById")
    @ApiOperation("查看签到金币配置表详情")
    public Result selectSignInRewardById(@ApiParam("签到天数奖励id")Long id){
        return tbSignInRewardService.selectSignInRewardById(id);
    }

    @GetMapping("selectSignInRewardList")
    @ApiOperation("获取签到金币配置表列表")
    public Result selectSignInRewardList(@ApiParam("页码")Integer page,
                                         @ApiParam("条数")Integer limit,
                                         @ApiParam("签到天数奖励实体")TbSigninReward tbSignInReward){
        return Result.success().put("data",tbSignInRewardService.selectSignInRewardList(page,limit,tbSignInReward));
    }

}
